import request from '@/config/axios'

export interface MessageVO {
        id: number
        sessionId: string
        msgType: number
        msgContent: string
        customerId: number
        customerName: string
        assistantId: number
        assistantName: string
        assistantAvator: string
}

// 查询对话消息列表
export const getMessagePage = async (params) => {
    return await request.get({url: `/service/message/page`, params})
}

// 查询对话消息详情
export const getMessage = async (id: number) => {
    return await request.get({url: `/service/message/get?id=` + id})
}

// 新增对话消息
export const createMessage = async (data: MessageVO) => {
    return await request.post({url: `/service/message/create`, data})
}

// 修改对话消息
export const updateMessage = async (data: MessageVO) => {
    return await request.put({url: `/service/message/update`, data})
}

// 删除对话消息
export const deleteMessage = async (id: number) => {
    return await request.delete({url: `/service/message/delete?id=` + id})
}

// 导出对话消息 Excel
export const exportMessage = async (params) => {
    return await request.download({url: `/service/message/export-excel`, params})
}